package com.guoxin.concurrentprogramming.chapter4.producerconsumer.disruptor;
/*
import com.lmax.disruptor.RingBuffer;

import java.nio.ByteBuffer;

*//**
 * 生产者
 *
 * @author Administrator
 *//*
public class Producer {

    //环形缓冲区
    private final RingBuffer<PCData> ringBuffer;


    public Producer(RingBuffer<PCData> ringBuffer) {
        this.ringBuffer = ringBuffer;
    }

    //将传入的ByteBuffer中的数据提取出来，并装载到环形缓冲区中
    public void pushData(ByteBuffer bb) {
        long sequence = ringBuffer.next();
        try {
            PCData pcData = ringBuffer.get(sequence);
            pcData.setValue(bb.getLong(0));
        } finally {
            //数据发布
            ringBuffer.publish(sequence);
        }
    }
}*/
